Optimal. Leaf size=98 \[ -\frac{2 (B-C) \sin (c+d x)}{a d}+\frac{(3 B-2 C) \sin (c+d x) \cos (c+d x)}{2 a d}-\frac{(B-C) \sin (c+d x) \cos (c+d x)}{d (a \sec (c+d x)+a)}+\frac{x (3 B-2 C)}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.231741, antiderivative size = 98, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 40, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.15, Rules used = {4072, 4020, 3787, 2635, 8, 2637} \[ -\frac{2 (B-C) \sin (c+d x)}{a d}+\frac{(3 B-2 C) \sin (c+d x) \cos (c+d x)}{2 a d}-\frac{(B-C) \sin (c+d x) \cos (c+d x)}{d (a \sec (c+d x)+a)}+\frac{x (3 B-2 C)}{2 a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4072
Rule 4020
Rule 3787
Rule 2635
Rule 8
Rule 2637
Rubi steps
\begin{align*} \int \frac{\cos ^3(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx &=\int \frac{\cos ^2(c+d x) (B+C \sec (c+d x))}{a+a \sec (c+d x)} \, dx\\ &=-\frac{(B-C) \cos (c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}+\frac{\int \cos ^2(c+d x) (a (3 B-2 C)-2 a (B-C) \sec (c+d x)) \, dx}{a^2}\\ &=-\frac{(B-C) \cos (c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}+\frac{(3 B-2 C) \int \cos ^2(c+d x) \, dx}{a}-\frac{(2 (B-C)) \int \cos (c+d x) \, dx}{a}\\ &=-\frac{2 (B-C) \sin (c+d x)}{a d}+\frac{(3 B-2 C) \cos (c+d x) \sin (c+d x)}{2 a d}-\frac{(B-C) \cos (c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}+\frac{(3 B-2 C) \int 1 \, dx}{2 a}\\ &=\frac{(3 B-2 C) x}{2 a}-\frac{2 (B-C) \sin (c+d x)}{a d}+\frac{(3 B-2 C) \cos (c+d x) \sin (c+d x)}{2 a d}-\frac{(B-C) \cos (c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}\\ \end{align*}
Mathematica [B] time = 0.409703, size = 197, normalized size = 2.01 \[ \frac{\sec \left (\frac{c}{2}\right ) \cos \left (\frac{1}{2} (c+d x)\right ) \left (4 d x (3 B-2 C) \cos \left (c+\frac{d x}{2}\right )-4 B \sin \left (c+\frac{d x}{2}\right )-3 B \sin \left (c+\frac{3 d x}{2}\right )-3 B \sin \left (2 c+\frac{3 d x}{2}\right )+B \sin \left (2 c+\frac{5 d x}{2}\right )+B \sin \left (3 c+\frac{5 d x}{2}\right )+4 d x (3 B-2 C) \cos \left (\frac{d x}{2}\right )-20 B \sin \left (\frac{d x}{2}\right )+4 C \sin \left (c+\frac{d x}{2}\right )+4 C \sin \left (c+\frac{3 d x}{2}\right )+4 C \sin \left (2 c+\frac{3 d x}{2}\right )+20 C \sin \left (\frac{d x}{2}\right )\right )}{8 a d (\cos (c+d x)+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.093, size = 211, normalized size = 2.2 \begin{align*} -{\frac{B}{ad}\tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) }+{\frac{C}{ad}\tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) }-3\,{\frac{ \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{3}B}{ad \left ( 1+ \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{2} \right ) ^{2}}}+2\,{\frac{C \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{3}}{ad \left ( 1+ \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{2} \right ) ^{2}}}-{\frac{B}{ad}\tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \left ( 1+ \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{2} \right ) ^{-2}}+2\,{\frac{C\tan \left ( 1/2\,dx+c/2 \right ) }{ad \left ( 1+ \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{2} \right ) ^{2}}}+3\,{\frac{B\arctan \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) }{ad}}-2\,{\frac{\arctan \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) C}{ad}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.4336, size = 304, normalized size = 3.1 \begin{align*} -\frac{B{\left (\frac{\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac{3 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a + \frac{2 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac{a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} - \frac{3 \, \arctan \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac{\sin \left (d x + c\right )}{a{\left (\cos \left (d x + c\right ) + 1\right )}}\right )} + C{\left (\frac{2 \, \arctan \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac{2 \, \sin \left (d x + c\right )}{{\left (a + \frac{a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )}{\left (\cos \left (d x + c\right ) + 1\right )}} - \frac{\sin \left (d x + c\right )}{a{\left (\cos \left (d x + c\right ) + 1\right )}}\right )}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.484015, size = 203, normalized size = 2.07 \begin{align*} \frac{{\left (3 \, B - 2 \, C\right )} d x \cos \left (d x + c\right ) +{\left (3 \, B - 2 \, C\right )} d x +{\left (B \cos \left (d x + c\right )^{2} -{\left (B - 2 \, C\right )} \cos \left (d x + c\right ) - 4 \, B + 4 \, C\right )} \sin \left (d x + c\right )}{2 \,{\left (a d \cos \left (d x + c\right ) + a d\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.131, size = 166, normalized size = 1.69 \begin{align*} \frac{\frac{{\left (d x + c\right )}{\left (3 \, B - 2 \, C\right )}}{a} - \frac{2 \,{\left (B \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - C \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )\right )}}{a} - \frac{2 \,{\left (3 \, B \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - 2 \, C \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + B \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 2 \, C \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1\right )}^{2} a}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]